package com.qingcheng.controller.order;


import com.alibaba.dubbo.config.annotation.Reference;
import com.qingcheng.pojo.order.CategoryReport;
import com.qingcheng.service.order.CategoryReportService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.time.LocalDate;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/categoryReport")
public class CategoryReportController {

    @Reference
    private CategoryReportService categoryReportService;

    @GetMapping("/report")
    public List<CategoryReport> categoryReport(int date){
        LocalDate localDate = LocalDate.now().minusDays(date);

        return categoryReportService.categoryReport(localDate);
    }

    @GetMapping("/categoryId")
    public List<Map> categoryId(String date1,String date2){

        System.out.println("1111");

       return categoryReportService.categoryId(date1,date2);

    }

}
